#include <bits/stdc++.h>
using namespace std;

map<string, int> words_fre;
int main() {
	int n;
	cin >> n;
	for (int i=0; i<n; i++) {
		string s;
		cin >> s; 
		
		for (int j=0; j<s.length(); j++) {
			s[j] = tolower(s[j]);
		}
		auto it = words_fre.find(s);
		if (it != words_fre.end()) {
			int &fre = it->second;
			fre ++;
		} else {
			words_fre.insert({s, 1});
		}
	}
	string s_max;
	int fre = 0;
	for (auto it = words_fre.begin(); it != words_fre.end(); it++) {
		if (fre < it->second) {
			fre = it->second;
			s_max = it->first;
		}
	}
	cout << s_max << endl; 
	return 0;
}
